﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersonaLibrary.Commands.CommandsForTotalItems
{
	internal class CommandsPackStrategy
	{
		private static CommandsPackStrategy _interop;

		private readonly Dictionary<Type, ICommandsPack> _cash;

		private CommandsPackStrategy()
		{
			_cash = new Dictionary<Type, ICommandsPack>
					   {
						   {typeof(Data.Employee), new EmployeeCommandsPack()}
					   };
		}

		public static CommandsPackStrategy Interop
		{
			get
			{
				if(_interop == null)
					_interop = new CommandsPackStrategy();
				return _interop;
			}
		}

		public ICommandsPack this[Type itemnType]
		{
			get
			{
				if(itemnType != null)
					if (_cash.ContainsKey(itemnType))
						return _cash[itemnType];
				return null;
			}
		}
	}
}
